<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      /* .box {
        border-top: 0.5px solid #000;
      } */
      /* .box {
        width: 100%;
        height: 0.5px;
        background-color: #000;
      } */

      .box1 {
        width: 100%;
        height: 1px;
        background-color: #000;
        margin-bottom: 20px;
      }

      .box2 {
        width: 100%;
        height: 1px;
        background-color: #000;
        transform: scaleY(0.5);
      }

      .box3 {
        position: relative;
        width: 100px;
        height: 100px;
        background-color: yellowgreen;
        margin-top: 20px;
      }

      @media screen and (-webkit-min-device-pixel-ratio: 2) {
        .box3::before {
          transform: scaleY(0.5);
        }
      }

      @media screen and (-webkit-min-device-pixel-ratio: 3) {
        .box3::before {
          transform: scaleY(0.3333333);
        }
      }

      .box3::before {
        position: absolute;
        left: 0;
        bottom: 0;
        content: " ";
        display: block;
        width: 100%;
        height: 1px;
        background-color: #000;
      }
    </style>
  </head>
  <body>
    <div class="box1"></div>

    <div class="box2"></div>

    <div class="box3"></div>
  </body>
</html>
